package demo1;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-08-10
 * Time: 19:43
 */
public class Test {
    public static void main1(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> ret = new ArrayList<>();

        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if(!str2.contains(ch + "")){
                ret.add(ch);
            }
        }
        for (int i = 0; i < ret.size(); i++) {
            System.out.print(ret.get(i));
        }
    }

    public static void main2(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> ret = new ArrayList<>();

        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if(!str2.contains(ch + "")){
                ret.add(ch);
            }
        }
        for (int i = 0; i < ret.size(); i++) {
            System.out.print(ret.get(i));
        }
    }

    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> ret = new ArrayList<>();

        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if(!str2.contains(ch + "")){
                ret.add(ch);
            }
        }
        for (int i = 0; i < ret.size(); i++) {
            System.out.print(ret.get(i));
        }
    }























}
